
<html><HEAD>
<LINK REL=STYLESHEET HREF="default.css" TYPE="text/css">
<TITLE>
Choosing colors </TITLE>
</HEAD>
<BODY>

<!-- Header -->
<p class="ancestor" align="right"><A HREF="pbugp109.htm">Previous</A>&nbsp;&nbsp;<A HREF="pbugp111.htm" >Next</A>
<!-- End Header -->
<A NAME="CAICDFCB"></A><h1>Choosing colors </h1>
<A NAME="TI2850"></A><p>The Window painter has two Color drop-down toolbars on PainterBar3
that display colors that you can use for the background and foreground
of components of the window. Initially,
the drop-down toolbars display these color selections:</p>
<A NAME="TI2851"></A><p><A NAME="TI2852"></A>
<ul>
<li class=fi>20 predefined colors</li>
<li class=ds>16 custom colors (labeled C)</li>
<li class=ds>The full set of Windows system colors
</li>
</ul>
</p>
<A NAME="TI2853"></A><h4>Windows system colors</h4>
<A NAME="TI2854"></A><p>The Windows system colors display in the same order as in
the TextColor and BackColor lists in the Properties view for a control.
They are labeled with letters that indicate the type of display
element they represent:<A NAME="TI2855"></A>
<ul>
<li class=fi>W
for windows </li>
<li class=ds>T for text in windows, title bars, menus, buttons,
and so on</li>
<li class=ds>A for the application workspace </li>
<li class=ds>B for button face, highlight, shadows, and borders</li>
<li class=ds>S for scroll bars</li>
<li class=ds>D for the desktop </li>
<li class=ds>M for menu bars</li>
<li class=ds>F for window frames</li>
<li class=ds>H for highlight</li>
<li class=ds>L for links
</li>
</ul>
</p>
<A NAME="TI2856"></A><p>The Windows system colors are those defined by the user in
the Windows Control Panel, so if you use these colors in your window,
the window colors will change to match the user's settings
at runtime.</p>
<A NAME="TI2857"></A><h4>Defining custom colors</h4>
<A NAME="TI2858"></A><p>You can define your own custom colors for use in windows,
user objects, and DataWindow objects.</p>
<A NAME="TI2859"></A><p><img src="images/proc.gif" width=17 height=17 border=0 align="bottom" alt="Steps"> To define and maintain custom colors:</p>
<ol><li class=fi><p>Select Design&gt;Custom Colors from
the menu bar.</p><p>The Color dialog box displays.</p><br><img src="images/wrkg21.gif"><br>
</li>
<li class=ds><p>Click in an empty color box in the list of custom
colors.</p></li>
<li class=ds><p>Choose an existing color or create the color you
want. You can start with one of the basic colors and customize it
in the palette to the right by dragging the color indicator with
the mouse. You can also specify precise values to define the color.</p></li>
<li class=ds><p>When you have the color you want, click Add to
Custom Colors.</p><p>The new color displays in the list of custom colors.</p></li>
<li class=ds><p>Select the new color in the list of custom colors.</p></li>
<li class=ds><p>Click OK.</p><p>The new color displays in the Color drop-down toolbars and
is available in all windows, user objects, and DataWindow objects
you create.</p></li></ol>
<br><A NAME="TI2860"></A><p>PowerBuilder saves custom colors in the [Colors] section
of the PowerBuilder initialization file, so they are available across
sessions.</p>
<A NAME="TI2861"></A><h4>Specifying foreground and background colors</h4>
<A NAME="TI2862"></A><p>You can assign colors to controls using the Painterbar or
the Properties view. The page in the Properties view that you use
depends on the control. For some controls you can change only the
background color, and for others you can change neither the foreground
nor the background color. These controls include CommandButton,
PictureButton, PictureHyperLink, Picture, ScrollBar, TrackBar, ProgressBar,
and OLE controls.</p>
<A NAME="TI2863"></A><p><img src="images/proc.gif" width=17 height=17 border=0 align="bottom" alt="Steps"> To assign a color using the PainterBar:</p>
<ol><li class=fi><p>Select the control.</p></li>
<li class=ds><p>Select either the foreground or background color
button from the PainterBar.</p></li>
<li class=ds><p>Select a color from the drop-down toolbar.</p></li></ol>
<br>
